<template>
  <div>
    <div style="width: 100%;">
      <el-popover
        placement="right"
        width="400"
        trigger="click"
      >
        <el-col>
          <el-form ref="colorForm" label-width="80px" size="mini">
            <el-form-item :label="$t('panel.minute')" class="form-item form-item-slider">
              <el-slider v-model="canvasStyleData.refreshTime" show-input :show-input-controls="false" input-size="mini" :min="1" :max="60" @change="onChangePanelStyle" />
            </el-form-item>
          </el-form>
        </el-col>
        <el-button slot="reference" size="mini" class="shape-item">{{ $t('panel.refresh_time') }} <i class="el-icon-setting el-icon--right" /></el-button>
      </el-popover>
    </div>
  </div>
</template>

<script>
// eslint-disable-next-line no-unused-vars
import { deepCopy } from '@/components/canvas/utils/utils'
import {
  CANVAS_STYLE
} from '@/views/panel/panel'

export default {
  name: 'PanelRefreshTime',
  props: {
  },
  computed: {
    canvasStyleData() {
      return this.$store.state.canvasStyleData
    }
  },
  created() {
    // 初始化赋值
    // if (!this.canvasStyleData.refreshTime) {
    //   this.canvasStyleData['refreshTime'] = CANVAS_STYLE.refreshTime
    // }
  },
  methods: {
    onChangePanelStyle() {
      this.$store.state.styleChangeTimes++
    }
  }
}
</script>

<style scoped>
  .avatar-uploader>>>.el-upload {
    width: 100px;
    height: 60px;
    line-height: 70px;
  }
  .avatar-uploader>>>.el-upload-list li{
    width: 100px !important;
    height: 60px !important;
  }
  .disabled>>>.el-upload--picture-card {
    display: none;
  }
  .shape-item{
    padding: 6px;
    border: none;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .form-item-slider>>>.el-form-item__label{
    font-size: 12px;
    line-height: 38px;
  }
  .form-item>>>.el-form-item__label{
    font-size: 12px;
  }
  .el-select-dropdown__item{
    padding: 0 20px;
  }
  span{
    font-size: 12px
  }
  .el-form-item{
    margin-bottom: 6px;
  }
</style>
